<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("basePath", basePath);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="${basePath}css/easyui.css">
<link rel="stylesheet" type="text/css" href="${basePath}css/icon.css">
<link rel="stylesheet" type="text/css" href="${basePath}css/demo.css">
<script type="text/javascript" src="${basePath}js/jquery.min.js"></script>
<script type="text/javascript" src="${basePath}js/jquery.easyui.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>查询玩家注册时间</title>
<script type="text/javascript">
	$(document).ready(
			function() {
				$('#w').window('close');
				/* $('#t1').datagrid({ onClickRow:
				   function () {
				       //单击行的时候，将单选按钮设置为选中
				       var id = $('#t1').datagrid("getSelected");
				       $("input[name='name']").each(function () {
				           if ($(this).val() == id.Id) {
				               $(this).attr("checked", true);
				           }
				       });
				   }
				});  */
				$('#t1').datagrid({
					singleSelect : (this.value == 1)
				});
				$('#queryRegistPlayers').click(
						function() {
							var rowServers = $('#t1').datagrid('getChecked');
							if (rowServers.length == 0
									|| rowServers.length == 0) {
								return;
							}
							var requestParams = "{\"servers\":";
							requestParams += "["
							$.each(rowServers, function(index, value) {
								requestParams += "{\"tag\"" + ":\""
										+ value['serverId'] + "\"},";
							});
							requestParams = requestParams.substring(0,
									requestParams.length - 1);
							requestParams += "]";

							requestParams += ",";
							requestParams += "\"startTime\":" + "\"" + $('#startTime').datetimebox('getValue') + "\",";
							requestParams += "}";
							var url = "QueryRegisterServlet?paras=" + requestParams;
							$.post(url, function(data) {
								/* $('#w').window('open');
								$('#w').html(data); */
							});
						});
			});

</script>
</head>
<body>
	<jsp:include page="gm/gmServers.jsp" />
	<div class="easyui-panel" title="" style="width: 400px">
		<div style="padding: 10px 60px 20px 60px">
			<form id="ff" method="post" action="QueryRegisterServlet">
				<table cellpadding="5">
					<form id="chooseGMServer" action="#" method="post"
						entyctype="text/plain">
						<table id="t1" title="选择需要查询的服务器"
							style="width: 100%; height: 300px"
							data-options="rownumbers:true,singleSelect:true,autoRowHeight:true,pagination:true,pageSize:10,
																											url:'GetGMServersServlet',method:'get',singleSelect:true">
							<thead>
								<tr>
									<th data-options="field:'ck',checkbox:true"></th>
									<th data-options="field:'serverId',width:50">id</th>
									<th data-options="field:'serverName',width:80">服务器名</th>
								</tr>
							</thead>
						</table>
					</form>
					</tr>
					<tr>
						<td>時間</td>
						<td><input id="startTime" class="easyui-datetimebox" required
							style="width: 200px" name="date" value="">
						</td>
					</tr>
					<tr><td><a href="#" class="easyui-linkbutton" id="queryRegistPlayers">加载(最多10秒返回结果)</a></td></tr>
				</table>
			</form>

		</div>
	</div>
</body>
</html>